package com.itheima.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/*@Component
@Aspect
@Order(2)*/
public class AOPAdvice {

    public void before(){
        System.out.println("前置before...");
    }

    public void after(){
        System.out.println("后置after...");
    }

    public void afterReturing(){
        System.out.println("返回后afterReturing...");
    }

    public void afterThrowing(){
        System.out.println("抛出异常后afterThrowing...");
    }

    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("环绕前around before...");
        Object ret = pjp.proceed();
        System.out.println("环绕后around after...");
        return ret;
    }


}
